package com.eastidea.live.entity;

// Generated Feb 8, 2013 11:13:15 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.SEQUENCE;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * AppCompany generated by hbm2java
 */
@Entity
@Table(name = "app_company", schema = "public")
public class AppCompany implements java.io.Serializable {

	private Long id;
	private String name;
	private String desc;
	private String logo;
	private int status;
	private Set<AppApplication> appApplications = new HashSet<AppApplication>(0);
	private Set<AppUser> appUsers = new HashSet<AppUser>(0);

	public AppCompany() {
	}

	public AppCompany(String name, int status) {
		this.name = name;
		this.status = status;
	}

	public AppCompany(String name, String desc, String logo, int status,
			Set<AppApplication> appApplications, Set<AppUser> appUsers) {
		this.name = name;
		this.desc = desc;
		this.logo = logo;
		this.status = status;
		this.appApplications = appApplications;
		this.appUsers = appUsers;
	}

	@SequenceGenerator(name = "generator", sequenceName = "app_company_seq")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 500)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "descr", length = 1000)
	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Column(name = "logo", length = 500)
	public String getLogo() {
		return this.logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	@Column(name = "status", nullable = false)
	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "appCompany")
	public Set<AppApplication> getAppApplications() {
		return this.appApplications;
	}

	public void setAppApplications(Set<AppApplication> appApplications) {
		this.appApplications = appApplications;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "appCompany")
	public Set<AppUser> getAppUsers() {
		return this.appUsers;
	}

	public void setAppUsers(Set<AppUser> appUsers) {
		this.appUsers = appUsers;
	}

}
